package com.hopes.bizz.close.gis.vo.hazard;

import cn.hutool.core.util.ObjUtil;
import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @author yumr
 * @ProjectName bizz
 * @Description 车辆预约类型统计
 * @time 2024/2/26 19:46
 */
@Data
public class ApplyCarTypeVO implements Serializable {

    private static final long serialVersionUID = -6147681253298509635L;

    private List<ApplyCarTypeChartVO> applyCarTypeChartList;


    public ApplyCarTypeVO() {
        this.applyCarTypeChartList = new ArrayList<>();
    }

    public ApplyCarTypeVO(List<ApplyCarTypeChartVO> applyCarTypeChartList) {
        this.applyCarTypeChartList = applyCarTypeChartList;
    }

    public Integer getCompanyCarNum() {
        return this.applyCarTypeChartList.stream().mapToInt(ApplyCarTypeChartVO::getCompanyCarNum).filter(ObjUtil::isNotNull).sum();
    }

    public Integer getNotCompanyCarNum() {
        return this.applyCarTypeChartList.stream().mapToInt(ApplyCarTypeChartVO::getNotCompanyCarNum).filter(ObjUtil::isNotNull).sum();
    }

}
